import bg1 from '@/assets/image/dCaptcha/captchaImg1.jpg'
import bg2 from '@/assets/image/dCaptcha/captchaImg2.jpg'
import bg3 from '@/assets/image/dCaptcha/captchaImg3.jpg'
import bg4 from '@/assets/image/dCaptcha/captchaImg4.jpg'
import bg5 from '@/assets/image/dCaptcha/captchaImg5.jpg'
import bg6 from '@/assets/image/dCaptcha/captchaImg6.jpg'
import bg7 from '@/assets/image/dCaptcha/captchaImg7.jpg'
import bg8 from '@/assets/image/dCaptcha/captchaImg8.jpg'
import bg9 from '@/assets/image/dCaptcha/captchaImg9.jpg'
import bg10 from '@/assets/image/dCaptcha/captchaImg10.jpg'
import bg11 from '@/assets/image/dCaptcha/captchaImg11.jpg'
import bg12 from '@/assets/image/dCaptcha/captchaImg12.jpg'
import bg13 from '@/assets/image/dCaptcha/captchaImg13.jpg'
import bg14 from '@/assets/image/dCaptcha/captchaImg14.jpg'
import bg15 from '@/assets/image/dCaptcha/captchaImg15.jpg'
import bg16 from '@/assets/image/dCaptcha/captchaImg16.jpg'
import bg17 from '@/assets/image/dCaptcha/captchaImg17.jpg'
import bg18 from '@/assets/image/dCaptcha/captchaImg18.jpg'
import bg19 from '@/assets/image/dCaptcha/captchaImg19.jpg'
import bg20 from '@/assets/image/dCaptcha/captchaImg20.jpg'
import bg21 from '@/assets/image/dCaptcha/captchaImg21.jpg'
import bg22 from '@/assets/image/dCaptcha/captchaImg22.jpg'
import bg23 from '@/assets/image/dCaptcha/captchaImg23.jpg'
import bg24 from '@/assets/image/dCaptcha/captchaImg24.jpg'
import bg25 from '@/assets/image/dCaptcha/captchaImg25.jpg'
import bg26 from '@/assets/image/dCaptcha/captchaImg26.jpg'
import bg27 from '@/assets/image/dCaptcha/captchaImg27.jpg'
import bg28 from '@/assets/image/dCaptcha/captchaImg28.jpg'
import bg29 from '@/assets/image/dCaptcha/captchaImg29.jpg'
import bg30 from '@/assets/image/dCaptcha/captchaImg30.jpg'

export const CaptchaProps = {
  l: {
    type: Number,
    default: 42
  },
  r: {
    type: Number,
    default: 10
  },
  w: {
    type: Number,
    default: 400
  },
  h: {
    type: Number,
    default: 220
  },
  text: {
    type: String,
    default: '向右拖动滑块填充拼图'
  },
  accuracy: {
    type: Number,
    default: 5
  },
  bgList: {
    type: Array,
    default: () => [
      bg1,
      bg2,
      bg3,
      bg4,
      bg5,
      bg6,
      bg7,
      bg8,
      bg9,
      bg10,
      bg11,
      bg12,
      bg13,
      bg14,
      bg15,
      bg16,
      bg17,
      bg18,
      bg19,
      bg20,
      bg21,
      bg22,
      bg23,
      bg24,
      bg25,
      bg26,
      bg27,
      bg28,
      bg29,
      bg30
    ]
  }
}

export const CaptchaEmits = [
  'onRefresh',
  'onVerifySuccess',
  'onVerifyFail',
  'onVerifyAgain',
  'onFulfilled'
]

export const {PI} = Math

export const sum = (x: number, y: number) => {
  return x + y
}

export const square = (x: number) => {
  return x * x
}

export const getRandomNumberByRange = (start, end) => {
  return Math.round(Math.random() * (end - start) + start)
}
